﻿using System;
using System.Configuration;
using System.Xml;

#if !WindowsCE
namespace FireEagleNet
{
    /// <summary>
    /// Summary description for FlickrConfigurationManager.
    /// </summary>
    internal class FireEagleConfigurationManager : IConfigurationSectionHandler
    {
        private static string ConfigSection = "FireEagleNet";
        private static FireEagleConfigurationSettings settings;

        public FireEagleConfigurationManager()
        {
        }

        public static FireEagleConfigurationSettings Settings
        {
            get
            {
                if (settings == null)
                {
                    settings = (FireEagleConfigurationSettings)System.Configuration.ConfigurationManager.GetSection(ConfigSection);
                }

                return settings;
            }
        }

        public object Create(object parent, object configContext, XmlNode section)
        {
            ConfigSection = section.Name;
            return new FireEagleConfigurationSettings(section);
        }
    }
}
#endif